import React, { Component } from 'react';

import { geobalContext } from "./common/js/globalData";

// 解构
let {Consumer} = geobalContext

class Child1 extends Component {
  constructor(props) {
    super(props);
  }
  state = {  }
  render() { 
    return ( 
      <>
        <Consumer>
          {
            value=>(
              <div>
                子组件2:
                子组件读取父组件的数据{value.name}
              </div>
            )
          }
        </Consumer>
      </>
     );
  }
}
 
export default Child1;